#ifndef __2BWT_FORMAT_H__
#define __2BWT_FORMAT_H__

#include <stdio.h>
#include <stdlib.h>
#include <iostream>

using namespace std;


class _2BWTFormat {
public:
	int qid;
	string read_id;
	string read;
	string chr_name;
	unsigned int position;
	int read_len;
	char strand;


        friend std::istringstream & operator>>(std::istringstream & alignment, _2BWTFormat& _2bwt) {
		string buf;
		
		getline(alignment, buf, '\t');
		_2bwt.qid = atoi(buf.c_str());
	
		getline(alignment, buf, '\t');
		_2bwt.read_id = buf;

		getline(alignment, buf, '\t');
		_2bwt.read = buf;
	
		getline(alignment, buf, '\t');
		_2bwt.chr_name = buf;

		getline(alignment, buf, '\t');
		_2bwt.position = atol(buf.c_str());
		_2bwt.position -= 1;

		getline(alignment, buf, '\t');
		_2bwt.read_len = atoi(buf.c_str());
	
		getline(alignment, buf, '\t');
		_2bwt.strand = buf[0];

		return alignment;
	};

public:
	int get_read_len() {return read_len;};
};



#endif /*__2BWT_FORMAT_H__*/


